package com.koro.feign;

import com.koro.dto.FindGoodsDTO;
import com.koro.dto.SaveGoodsDTO;
import com.koro.vo.FindGoodsVO;
import com.koro.vo.ResponseObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "shop-service-goods")
public interface GoodsFeignClient {

    String API_PREFIX = "/goods";

    @PostMapping("/goods/findById")
    ResponseObject<FindGoodsVO> findById(@RequestBody FindGoodsDTO dto);

    @PostMapping(API_PREFIX + "/save")
    ResponseObject<Integer> save(@RequestBody SaveGoodsDTO dto);

    @GetMapping(API_PREFIX + "/updataseckill")
    ResponseObject<Integer> updataseckill(@RequestParam("id") Integer id);

    @PostMapping("/goods/findAll")
    ResponseObject<List<FindGoodsVO>> findAll(@RequestBody FindGoodsDTO dto);
}
